package org.example.lostandfound.util;


import java.security.SecureRandom;

public class VerificationCodeUtil{

  public static String generateVerificationCode(int length){
      SecureRandom random = new SecureRandom();
      String characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
      StringBuilder sb = new StringBuilder(length);
      for (int i = 0; i < length; i++) {
          int index = random.nextInt(characters.length());
          sb.append(characters.charAt(index));
      }
      return sb.toString();
  }
}
